<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改通信节点')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-centralControllerCommunicationNode-edit" th:object="${topCentralControllerCommunicationNode}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">通信节点名称：</label>
                <div class="col-sm-8">
                    <input name="nodeTitle" th:field="*{nodeTitle}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">通信类型：</label>
                <div class="col-sm-8">
                    <select name="channelType" class="form-control m-b">
                        <option value="">所有</option>
                    </select>
                    <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">ip地址：</label>
                <div class="col-sm-8">
                    <input name="ipAddress" th:field="*{ipAddress}" class="form-control" type="text">
                </div>
            </div>
    <div class="form-group">
        <label class="col-sm-3 control-label">端口号：</label>
        <div class="col-sm-8">
            <input name="ipPort" th:field="*{ipPort}" type="text" class="form-control" >
        </div>
    </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">串口名称：</label>
                <div class="col-sm-8">
                    <input name="comTitle" th:field="*{comTitle}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">OPCUA地址：</label>
                <div class="col-sm-8">
                    <textarea name="opcuaAddress" class="form-control">[[*{opcuaAddress}]]</textarea>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">授权帐号：</label>
                <div class="col-sm-8">
                    <input name="authUser" th:field="*{authUser}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">授权密码：</label>
                <div class="col-sm-8">
                    <input name="authPass" th:field="*{authPass}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">状态：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('data_normal_disable')}">
                        <input type="radio" th:id="${'state_' + dict.dictCode}" name="state" th:value="${dict.dictValue}" th:field="*{state}">
                        <label th:for="${'state_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
    <div class="form-group">
        <label class="col-sm-3 control-label">权重：</label>
        <div class="col-sm-8">
            <input name="weight" th:field="*{weight}" type="text" class="form-control" >
        </div>
    </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">描述：</label>
                <div class="col-sm-8">
                    <textarea name="remark" class="form-control">[[*{remark}]]</textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "central/centralControllerCommunicationNode";
        $("[name=ipPort]").inputSpinner();
        $("[name=weight]").inputSpinner();

        $("#form-centralControllerCommunicationNode-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operation.update(prefix, $.common.formToJSON());
            }
        }
    </script>
</body>
</html>